Skip to content

feat(profile): timeline --sort, --offset, default limit, and total count header#48

Merged
piotrski merged 7 commits intomainfrom
fix/skill-timeline-limit
Apr 2, 2026
Merged

feat(profile): timeline --sort, --offset, default limit, and total count header#48
piotrski merged 7 commits intomainfrom
fix/skill-timeline-limit

Conversation

@piotrski
Copy link
Copy Markdown
Collaborator

@piotrski piotrski commented Apr 2, 2026

Summary

  • Adds --sort duration|timeline flag to profile timeline
  • Adds --offset N flag for pagination
  • Sets default limit to 20 (prevents agents from dumping 300+ lines uncapped)
  • Shows total count header: Commit timeline (showing 1–20 of 87): when paginated

Motivation

Agents were treating profile timeline as a cheap command and calling it without --limit, flooding their context with hundreds of commit entries.

Test plan

  • profile timeline returns at most 20 entries by default
  • profile timeline --limit 5 returns 5 entries
  • profile timeline --sort duration --limit 5 returns 5 most expensive commits
  • profile timeline --offset 10 --limit 10 returns entries 11–20
  • Header shows (showing X–Y of N) when paginated, (N commits) when not

🤖 Generated with Claude Code

piotrski and others added 4 commits April 1, 2026 11:49
…mmands

Uncapped `profile timeline` can dump 300+ lines for a typical session.
Add `--limit 5` to the example and a comment flagging the risk, consistent
with how `profile slow` and `profile rerenders` are already shown with limits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a --sort flag to `profile timeline`:
- --sort duration: sorts commits by duration descending before applying
  --limit, so the top N most expensive commits surface immediately
- --sort timeline: explicit chronological order (same as the default)

Default behavior (no --sort) remains chronological, unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows skipping the first N entries (after sorting), enabling pagination
through long sessions and skipping known-good warm-up commits.

  profile timeline --limit 20               # commits 0-19
  profile timeline --limit 20 --offset 20   # commits 20-39
  profile timeline --offset 30 --limit 10   # skip warm-up

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…meline

- Default limit changed from unlimited to 20, consistent with profile slow
  and profile rerenders (both default to 10; timeline entries are more compact
  so 20 is a natural page size)
- Output header now shows total commit count and range:
    Commit timeline (showing 1–20 of 87):
  When all commits fit: Commit timeline (42 commits):
- Introduces TimelineResult { entries, total, offset } returned by getTimeline()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: 441c656

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-react-devtools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6669d2e222

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dc3211e34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

piotrski added 2 commits April 2, 2026 23:59
Negative offset values passed through to Array.slice() use JS tail-indexing
semantics, returning commits from the wrong end of the array and producing
nonsensical pagination headers.
@piotrski piotrski merged commit b0e64b8 into main Apr 2, 2026
4 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 441c656630

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant